//
//  HNCourseEvaluationsTC.m
//  ZYManagementSystem
//
//  Created by 星道 on 17/6/16.
//  Copyright © 2017年 焕宁. All rights reserved.
//

#import "HNCourseEvaluationsTC.h"

@implementation HNCourseEvaluationsTC
{
    IBOutlet UILabel *_Name;
    IBOutlet UILabel *_Times;
    IBOutlet UIButton *_Select;
}


/**
 选择
 */
- (IBAction)ClickSelct:(UIButton *)sender {

    self.ClickSelect(sender);
}



/**
 评价
 */
- (IBAction)ClickEvaluation:(UIButton *)sender {

    self.ClickEvaluation();
}



- (instancetype (^)(ZYCourseAttendanceTowModel *))Model {

    return ^(ZYCourseAttendanceTowModel *Model) {

        _Name.text = Model.IsAddStudent?Model.petName:Model.user_petName;
        _Times.text = Model.IsAddStudent? Model.username:Model.record;
        _Name.text = [NSString stringWithFormat:@"%@",Model.IsAddStudent?Model.petName:Model.user_petName];
        _Times.text = [NSString stringWithFormat:@"%@",Model.IsAddStudent?Model.username:Model.record];

        //2已签到 设为选中 1未签到，设为未选中
        _Select.selected = [Model.isSign isEqualToNumber:@1]?NO:YES;

        if ([Model.isSign isEqualToNumber:@3]) {

            _Select.hidden = YES;
        } else {

            _Select.hidden = NO;
            if ([Model.isSign isEqualToNumber:@2]) {

                _Select.selected = YES;
            } else {

                _Select.selected = NO;
            }
        }

        return self;
    };
}
@end
